package com.shxzz.easy12306.services.ticket.service;

import com.shxzz.easy12306.services.ticket.dto.req.CancelTicketOrderReqDTO;
import com.shxzz.easy12306.services.ticket.dto.req.PurchaseTicketReqDTO;
import com.shxzz.easy12306.services.ticket.dto.req.RefundTicketReqDTO;
import com.shxzz.easy12306.services.ticket.dto.req.TicketPageQueryReqDTO;
import com.shxzz.easy12306.services.ticket.dto.resp.PurchaseTicketRespDTO;
import com.shxzz.easy12306.services.ticket.dto.resp.TicketPageQueryRespDTO;

/**
 * 车票服务层接口
 * @author shxzz
 * @create 2024-03-04-20:22
 */
public interface TicketService {
    /**
     * 车票查询
     *
     * @param ticketPageQueryReqDTO 分页查询参数
     * @return 查询结果
     */
    TicketPageQueryRespDTO search(TicketPageQueryReqDTO ticketPageQueryReqDTO);

    /**
     * 车票购买
     */
    PurchaseTicketRespDTO purchaseTicket(PurchaseTicketReqDTO requestParam);

    /**
     * 车票购买 V2 版本
     */
    PurchaseTicketRespDTO purchaseTicketV2(PurchaseTicketReqDTO requestParam);

    /**
     * 执行购买车票，防止事务失效
     */
    PurchaseTicketRespDTO executePurchaseTicket(PurchaseTicketReqDTO requestParam);

    /**
     * 取消车票订单
     */
    void cancelTicketOrder(CancelTicketOrderReqDTO requestParam);

    /**
     * 车票退款
     */
    Void commonTicketRefund(RefundTicketReqDTO requestParam);
}
